//
//  LPAreenaController.m
//  彩票
//
//  Created by liupan on 2016/11/25.
//  Copyright © 2016年 liupan. All rights reserved.
//

#import "LPAreenaController.h"

@interface LPAreenaController ()

@end

@implementation LPAreenaController
//当第一次加载view的时候调用
//如果自定义View，重写这个方法
- (void)loadView{

    UIImageView *imageView=[[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.view=imageView;
    //设置图片
   imageView.image=[UIImage imageNamed:@"NLArenaBackground"];
    //设置允许用户交互
    imageView.userInteractionEnabled=YES;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    UISegmentedControl *sgControl = [[UISegmentedControl alloc]initWithItems:@[@"足球",@"篮球"]];
    NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
    dictionary[NSForegroundColorAttributeName] = [UIColor whiteColor];
    [sgControl setTitleTextAttributes:dictionary forState:UIControlStateNormal];
    
    [sgControl setBackgroundImage:[UIImage imageNamed:@"CPArenaSegmentBG"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [sgControl setBackgroundImage:[UIImage imageNamed:@"CPArenaSegmentSelectedBG"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    sgControl.selectedSegmentIndex=0;
    sgControl.tintColor = [UIColor colorWithRed:0 green:142/255.0 blue:143/255.0 alpha:1];
    self.navigationItem.titleView=sgControl;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
